package web;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

@WebServlet("/startServlet")
public class startServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        /*请求参数*/
        HttpSession session = request.getSession();

        String IMEI = request.getParameter("IMEI");
        session.setAttribute("IMEI",IMEI);
        if (IMEI==null || "".equals(IMEI))
        {
            request.getRequestDispatcher("/login.jsp").forward(request,response);
        }else {
            request.getRequestDispatcher("userNodeDataServlet").forward(request,response);
            //response.sendRedirect("userNodeDataServlet");
        }

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request,response);
    }
}
